#include <iostream>
#include <unistd.h>
#include <signal.h>
using namespace std;

void handler(int signo){
    cout << "process get a signal: " << signo << endl;
}

int main(){
    //signal(2, handler);

    for (int i = 1; i < 31; i++){
        signal(i, handler);
    }

    while (true)
    {
        cout << "I am a process, pid: " << getpid() << endl;
        sleep(2);
    }
    return 0;
}